//
//  EventEditDropDownController.m
//  Runone
//
//  Created by runone02 on 16/9/5.
//  Copyright © 2016年 runone. All rights reserved.
//

#import "EventEditDropDownController.h"


@interface EventEditDropDownController ()

@end

@implementation EventEditDropDownController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.preferredContentSize=CGSizeMake(140, 145);
    
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"CellID"];
    }

#pragma mark - Table view data source

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return self.dataSource.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *cellID=@"CellID";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath];
    if (cell==nil) {
        cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    cell.textLabel.text=self.dataSource[indexPath.row];
    return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
        self.index(indexPath.row);
    
    [self dismissViewControllerAnimated:YES completion:nil];
}
@end
